package com.sc.study.student.service.impl;

import java.util.List;

import com.sc.study.foundation.mapper.ScSubjectMapper;
import com.sc.study.student.mapper.ScStudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sc.study.student.mapper.ScStudentSubjectMapper;
import com.sc.study.student.domain.ScStudentSubject;
import com.sc.study.student.service.IScStudentSubjectService;

/**
 * 学员课程Service业务层处理
 * 
 * @author sc
 * @date 2022-02-27
 */
@Service
public class ScStudentSubjectServiceImpl implements IScStudentSubjectService 
{
    @Autowired
    private ScStudentSubjectMapper scStudentSubjectMapper;
    @Autowired
    private ScSubjectMapper scSubjectMapper;
    @Autowired
    private ScStudentMapper scStudentMapper;


    /**
     * 查询学员课程
     * 
     * @param id 学员课程主键
     * @return 学员课程
     */
    @Override
    public ScStudentSubject selectScStudentSubjectById(Long id)
    {
        return scStudentSubjectMapper.selectScStudentSubjectById(id);
    }

    /**
     * 查询学员课程列表
     * 
     * @param scStudentSubject 学员课程
     * @return 学员课程
     */
    @Override
    public List<ScStudentSubject> selectScStudentSubjectList(ScStudentSubject scStudentSubject)
    {
        return  scStudentSubjectMapper.selectScStudentSubjectList(scStudentSubject);
    }

    /**
     * 新增学员课程
     * 
     * @param scStudentSubject 学员课程
     * @return 结果
     */
    @Override
    public int insertScStudentSubject(ScStudentSubject scStudentSubject)
    {
        return scStudentSubjectMapper.insertScStudentSubject(scStudentSubject);
    }

    /**
     * 修改学员课程
     * 
     * @param scStudentSubject 学员课程
     * @return 结果
     */
    @Override
    public int updateScStudentSubject(ScStudentSubject scStudentSubject)
    {
        return scStudentSubjectMapper.updateScStudentSubject(scStudentSubject);
    }

    /**
     * 批量删除学员课程
     * 
     * @param ids 需要删除的学员课程主键
     * @return 结果
     */
    @Override
    public int deleteScStudentSubjectByIds(Long[] ids)
    {
        return scStudentSubjectMapper.deleteScStudentSubjectByIds(ids);
    }

    /**
     * 删除学员课程信息
     * 
     * @param id 学员课程主键
     * @return 结果
     */
    @Override
    public int deleteScStudentSubjectById(Long id)
    {
        return scStudentSubjectMapper.deleteScStudentSubjectById(id);
    }

    /**
     * 查询学员课程列表包含科目和学员
     *
     * @param scStudentSubject 学员课程
     * @return 学员课程
     */
    @Override
    public List<ScStudentSubject> selectScStudentSubjectListIncludeSubjectAndStudent(ScStudentSubject scStudentSubject) {
        return scStudentSubjectMapper.selectScStudentSubjectListIncludeSubjectAndStudent(scStudentSubject);
    }
}
